package com.ruoyi.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.ParkingCardRefundMapper;
import com.ruoyi.domain.ParkingCardRefund;
import com.ruoyi.service.IParkingCardRefundService;

/**
 * 停车卡退款Service业务层处理
 * 
 * @author dongdong
 * @date 2025-11-07
 */
@Service
public class ParkingCardRefundServiceImpl implements IParkingCardRefundService 
{
    @Autowired
    private ParkingCardRefundMapper parkingCardRefundMapper;

    /**
     * 查询停车卡退款
     * 
     * @param id 停车卡退款主键
     * @return 停车卡退款
     */
    @Override
    public ParkingCardRefund selectParkingCardRefundById(Long id)
    {
        return parkingCardRefundMapper.selectParkingCardRefundById(id);
    }

    /**
     * 查询停车卡退款列表
     * 
     * @param parkingCardRefund 停车卡退款
     * @return 停车卡退款
     */
    @Override
    public List<ParkingCardRefund> selectParkingCardRefundList(ParkingCardRefund parkingCardRefund)
    {
        return parkingCardRefundMapper.selectParkingCardRefundList(parkingCardRefund);
    }

    /**
     * 新增停车卡退款
     * 
     * @param parkingCardRefund 停车卡退款
     * @return 结果
     */
    @Override
    public int insertParkingCardRefund(ParkingCardRefund parkingCardRefund)
    {
        parkingCardRefund.setCreateTime(DateUtils.getNowDate());
        return parkingCardRefundMapper.insertParkingCardRefund(parkingCardRefund);
    }

    /**
     * 修改停车卡退款
     * 
     * @param parkingCardRefund 停车卡退款
     * @return 结果
     */
    @Override
    public int updateParkingCardRefund(ParkingCardRefund parkingCardRefund)
    {
        parkingCardRefund.setUpdateTime(DateUtils.getNowDate());
        return parkingCardRefundMapper.updateParkingCardRefund(parkingCardRefund);
    }

    /**
     * 批量删除停车卡退款
     * 
     * @param ids 需要删除的停车卡退款主键
     * @return 结果
     */
    @Override
    public int deleteParkingCardRefundByIds(Long[] ids)
    {
        return parkingCardRefundMapper.deleteParkingCardRefundByIds(ids);
    }

    /**
     * 删除停车卡退款信息
     * 
     * @param id 停车卡退款主键
     * @return 结果
     */
    @Override
    public int deleteParkingCardRefundById(Long id)
    {
        return parkingCardRefundMapper.deleteParkingCardRefundById(id);
    }
}
